public class Text {
    public int removeDuplicates(int[] nums) {
        int n = nums.length;
        int fast = 1;
        int slow = 1;
        while(fast<n){
            if(nums[fast]!=nums[fast-1]){
                nums[slow] = nums[fast];
                slow++;
            }
            fast++;
        }

        return slow;
    }
}
